package edu.sctu.practice.class02.liqing.test03;

/**
 * Created by 123456 on 2015/10/9.
 */

public class MyTime {
    private int hour;
    private int minute;
    private int second;

    public MyTime(int hour, int minute, int second) {
        this.hour = hour;
        this.minute = minute;
        this.second = second;
    }

    public void display() {
        System.out.println("时间为" + hour + ":" + minute + ":" + second);
    }
    public void addHour(int hou) {
        this.hour += hour;
        System.out.println("对时进行加法运算的结果为："+this.hour);
    }

    public void addMinute(int min) {
        this.minute+=min;
        System.out.println("对分进行加法运算的结果为："+this.minute);
    }
    public void addSecond(int sec) {
     this.second += sec;
        System.out.println("对秒进行加法运算的结果为："+this.second);
    }
    public void subHour(int hou) {
        this.hour -= hour;
        System.out.println("对时进行减法运算的结果为："+this.hour);
    }

    public void subMinute(int min) {
        this.minute -= min;
        System.out.println("对分进行减法运算的结果为："+this.minute);
    }
    public void subSecond(int sec) {
        this.second -= sec;
        System.out.println("对秒进行减法运算的结果为："+this.second);
    }
}